[HVM][VMX] Clear vmxe when VMX is not enabled.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 29 Sep 2006 10:26:33 +0000 (11:26 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 29 Sep 2006 10:26:33 +0000 (11:26 +0100)
commit6a6ea8c94e1622738ff05c9e4676a462b96192a3
tree72280a324a6c6c3a6b6dd9957f070cb8c1f6c7bd
parente32782e508a2c786e0e3153fbbd5040b0ef2c8db
[HVM][VMX] Clear vmxe when VMX is not enabled.

The current Xen code keeps X86_CR4_VMXE set even if VMXON has not been
executed. The stop_vmx() code assumes that it is possible to call
VMXOFF if X86_CR4_VMXE is set which is not always true. Calling VMXOFF
without VMXON results in an illegal opcode trap, and to avoid this condition
this patch makes sure that X86_CR4_VMXE is only set when VMXON has
been called.

Tested using x86_32 on a Pentium D 930.

Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
xen/arch/x86/hvm/vmx/vmx.c